package com.itbupt.mybatis.session.defaults;

import com.itbupt.mybatis.binding.MapperRegistry;
import com.itbupt.mybatis.session.SqlSession;
import com.itbupt.mybatis.session.SqlSessionFactory;

/**
 * @Author dingchang
 * @Date 2025/6/1 16:14
 * @Description:
 */
public class DefaultSqlSessionFactory implements SqlSessionFactory {

    private MapperRegistry mapperRegistry;

    public DefaultSqlSessionFactory(MapperRegistry mapperRegistry) {
        this.mapperRegistry = mapperRegistry;
    }

    @Override
    public SqlSession openSession() {
        return new DefaultSqlSession(mapperRegistry);
    }

}
